<template>
	<view class="main">
		<van-toast id="van-toast" />
		<tou_hand1 handtitle='意见反馈'></tou_hand1>
		<view class="show">
			<van-field
			  :value="message"
			  @change="changeMessage"
			  autosize
			  type="textarea"
			  maxlength="200"
			  placeholder="请输入你反馈的内容"
			/>
			<view class="sbtn" @click="gobtn">
				提交内容
			</view>
		</view>
	</view>
</template>

<script>
	import tou_hand1 from '../../components/tou_hand2/tou_hand2.vue'
	
	export default {
		components: {tou_hand1},
		mounted() {

		},

		data() {
			return {
				message:""
			}
		},
		onLoad() {

		},
		methods: {
			gobtn(){
				if(this.message){
					let data = {
						content:this.message
					}
					this.$base.request('feedback', 'POST', data)
						.then(res => {
							if(res.data.code==200){
								this.$toast.success('提交成功')
								uni.navigateBack()
							}else{
								this.$toast.fail(res.data.msg)
							}
						})
						.catch(err => {
							
						})
				}else{
					this.$toast.fail('请输入内容')
				}
				
			},
			changeMessage(event) {
				this.message = event.mp.detail;
			},
			
		}
	}
</script>

<style lang="scss" scoped>
	.main {
		width: 100%;
		height: 100vh;
		overflow-x: hidden;
		background-color: #2A3034;

		.show{
			width: 100%;
			box-sizing: border-box;
			padding: 62upx 31upx;
			/deep/.van-cell{
				width: 686upx;
				height: 475upx;
				background-color: #3A4044;
			}
			/deep/.van-cell:not(:last-child)::after{
				border-bottom: 0upx;
			}
			/deep/.van-field__control{
				color: #fff;
			}
			.sbtn{
				width: 686upx;
				height: 88upx;
				border-radius: 40upx;
				background-color: #8DC321;
				font-size: 28upx;
				font-family: PingFang SC Bold, PingFang SC Bold-Bold;
				font-weight: 700;
				text-align: center;
				line-height: 88upx;
				color: #ffffff;
				margin-top: 56upx;
			}
		}
		
	}
</style>
